﻿using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x020001EA RID: 490
public class PresetSelectUISets
{
	// Token: 0x06000CFF RID: 3327 RVA: 0x0004DF64 File Offset: 0x0004C164
	public PresetSelectUISets(EditMode editMode, GameObject toggleParent, MoveableThumbnailSelectUI selectUI, string title, List<CustomSelectSet> setDatas, UnityAction<CustomSelectSet> act)
	{
		this.title = title;
		this.act = act;
		this.setDatas = setDatas;
		this.toggle = editMode.CreatePresetListToggle(toggleParent);
		this.select = selectUI;
		this.select.gameObject.SetActive(false);
		this.toggle.Setup(this.select);
		this.toggle.GetComponentInChildren<Text>().text = title;
		this.toggle.toggle.onValueChanged.AddListener(new UnityAction<bool>(this.SetupSelect));
	}

	// Token: 0x06000D00 RID: 3328 RVA: 0x0004DFF8 File Offset: 0x0004C1F8
	private void SetupSelect(bool flag)
	{
		if (flag)
		{
			this.select.Setup(this.title, this.setDatas, new UnityAction<MoveableUI.STATE>(this.toggle.OnChangeState), new UnityAction<CustomSelectSet>(this.OnChange));
		}
	}

	// Token: 0x06000D01 RID: 3329 RVA: 0x0004E034 File Offset: 0x0004C234
	private void OnChange(CustomSelectSet set)
	{
		if (this.act != null)
		{
			this.act(set);
		}
	}

	// Token: 0x04000D56 RID: 3414
	public PresetListToggle toggle;

	// Token: 0x04000D57 RID: 3415
	public MoveableThumbnailSelectUI select;

	// Token: 0x04000D58 RID: 3416
	private UnityAction<CustomSelectSet> act;

	// Token: 0x04000D59 RID: 3417
	private List<CustomSelectSet> setDatas;

	// Token: 0x04000D5A RID: 3418
	private string title;
}
